// 导入token
// import { getLocalToken } from '@/utils/token.js'
// 封装获取用户搜索历史
import _ajax from '@/utils/http.js'
function appV10SearchHistories () {
  return _ajax({
    url: '/app/v1_0/search/histories',
    method: 'get'
    // Authorization: getLocalToken()
  })
}

// 删除用户搜索历史
function deleteSearchHistories () {
  return _ajax({
    url: '/app/v1_0/search/histories',
    method: 'delete'
  })
}

// 获取搜索结果
function appV10Search (params) {
  return _ajax({
    url: '/app/v1_0/search',
    params
    // 需要必备参数（q）
  })
}

// 获取联想建议（自动补全）
function appV10Suggestion (params) {
  return _ajax({
    url: '/app/v1_0/suggestion',
    params
    // 需要必备参数（q）
  })
}

// 按需导出
export {
  appV10SearchHistories,
  deleteSearchHistories,
  appV10Search,
  appV10Suggestion
}
